<%@ page contentType="text/html; charset=utf-8"%>
<%@ include file="../../../common/include.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>报表模板管理</title>
<jsp:include page="../../../common/head.jsp"></jsp:include>
<script language="javaScript">	
	function showReportDetail(reportId){
		//页面父对象
		var arg = window.top.dialogArguments;
		var paramArr = arg.xjReportEngine.paramArr;
		var param="";
		if(paramArr!=null)
		{
			for(var i=0;i<paramArr.length;i++)
			{
				if(paramArr[i][0]==reportId)
					param = paramArr[i][1];
			}
		}
		var url = "listCommonDetailReportEngine.do?type=export&reportId="+reportId;
		if(param!="")
			url+="&"+param;
		window.parent.frame_right.location.href=url;
	}
	// 导出报表
	function exportReport(reportId)
	{
		window.top.returnValue=reportId+";jxl";
		window.top.close();
	}
	// 导出报表
	function exportJxlsReport(reportId)
	{
		window.top.returnValue=reportId+";jxls";
		window.top.close();
	}
	function exportJasperReport(reportId,exportType)
	{
		window.top.returnValue=reportId+";"+exportType;
		window.top.close();
	}
</script>
	</head>
	<body>
	<form name="form1" action="listReportEngine.do" method="post">
	<input name="reportEngine.belongTable" type="hidden" value="${reportEngine.belongTable}"/>
	<div id="body_div">
	<w:ShowTitle name="报表模板选择">
	</w:ShowTitle>
	<div id="body_content">
				<table width="100%">
					<tr>
						<td class="td_title">
							模板名称
						</td>
						<td class="td_title" width="120">
							模板类型
						</td>
						<td class="td_title" width="60">
							操作
						</td>
					</tr>
					<c:forEach items="${datalist}" var="obj">
						<tr>
							<td>
								${obj.reportName}
							</td>
							<td>
								<c:choose>
									<c:when test="${obj.reportType eq 'jxl'}">excel报表</c:when>
						   			<c:when test="${obj.reportType eq 'jxls'}">excel模板型报表</c:when>
						   			<c:when test="${obj.reportType eq 'jasperReport'}">jasperReport报表</c:when>
								</c:choose>
							</td>
							<td>
								<c:choose>
									<c:when test="${obj.reportType eq 'jxl'}">
										<a href="#" onclick="exportReport('${obj.reportId}')">导出</a>
										<a href="#" onclick="showReportDetail('${obj.reportId}')">详细</a>
									</c:when>
									<c:when test="${obj.reportType eq 'jxls'}">
										<a href="#" onclick="exportJxlsReport('${obj.reportId}')">导出</a>
									</c:when>
									<c:when test="${obj.reportType eq 'jasperReport'}">
										<a href="#" onclick="exportJasperReport('${obj.reportId}','pdf')" title="pdf格式"><img src="${ctx}/jsp/common/report_engine/ico.pdf.png"></img></a>
										<a href="#" onclick="exportJasperReport('${obj.reportId}','rtf')" title="word格式"><img src="${ctx}/jsp/common/report_engine/ico.doc.png"></img></a>
										<a href="#" onclick="exportJasperReport('${obj.reportId}','html')" title="html格式"><img src="${ctx}/jsp/common/report_engine/ico.html.png"></img></a>
									</c:when>
								</c:choose>
							
							</td>
						</tr>
					</c:forEach>
				</table>
			</div>
	</div>
	</form>
	</body>
</html>




